#pragma once


#include "Pages/EditorPageViewModel.h"
#include "EditorMeshPageModel.h"
#include "EditorMeshPageViewModel.m.h"

class RScene;

RCLASS(ExtraHeader = "Scene/Scene.h")
class REditorMeshPageViewModel : public REditorPageViewModel 
{
    ROBJECT

public:
    ~REditorMeshPageViewModel() override;

    void BindModel(TSharedObjectPtr<REditorPageModel> InModel) override;
    TSharedObjectPtr<RTexture2D> GetIcon() const override;
    CString GetTitle() const override;

protected:
    TSharedObjectPtr<RTexture2D> Icon;
    TWeakObjectPtr<REditorMeshPageModel> Model;


public:
    TSharedObjectPtr<RStaticMesh> GetMesh() const;

    TSharedObjectPtr<RScene> GetMeshScene() const;
    
    float GetViewDistanceToMesh();
    float GetMeshHeight() const;
protected:
    RFIELD()
    TSharedObjectPtr<RScene> MeshScene;

    float ViewDistanceToMesh;
};
